package Work;

//判断是否为3个连续的奇数
public class Test5 {
    public static void main(String[] args) {
        int[] array={1,5,3,2,4,8};
        System.out.println(continuousThreeOddNumber(array));
    }
    public static boolean continuousThreeOddNumber(int[] array) {
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            if(array[i] % 2 == 1) {
                count++;
                if(count == 3) {
                    return true;
                }
            }
            else {
                count = 0;
            }
        }
        return false;
    }
}
